package com.zhiwei.codesecurity.web.api.jobtask;

import com.zhiwei.codesecurity.common.base.BaseJob;
import com.zhiwei.codesecurity.common.utils.SpringContextHolder;
import com.zhiwei.codesecurity.entity.ScheduleJob;
import com.zhiwei.codesecurity.service.taskadd.ITaskAddService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class DownSvnAndGitFileJobTask extends BaseJob {
    private final static Logger logger = LoggerFactory.getLogger(DownSvnAndGitFileJobTask.class);

    @Override
    public void handeln(ScheduleJob scheduleJob) throws Exception {
        logger.info("======begin 从GIT或SVN远程下载需要扫描的代码文件. scheduleJobId={}, jobName={}======", scheduleJob.getScheduleJobId(),
                scheduleJob.getJobName());
        ITaskAddService taskAddService = SpringContextHolder.getBean("taskAddService");
        taskAddService.downSvnAndGitFileToZip();
        logger.info("======end 从GIT或SVN远程下载需要扫描的代码文件. scheduleJobId={}, jobName={}======", scheduleJob.getScheduleJobId(),
                scheduleJob.getJobName());
    }
}
